package com.wanqian.redis.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import javax.jms.Topic;

/**
 * @Author: wanqian
 * @Date: 2021/3/13 15:13
 */
@Service
public class SenderService {

    @Autowired
    private Topic topic;

    @Autowired
    private JmsMessagingTemplate template;

    public void send(String msg) {
        template.convertAndSend(topic, msg);
    }

//    @Scheduled(fixedDelay = 3000)
//    public void sendSchedule() {
//        this.send("定时发送");
//    }

}
